{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "base_url = 'https://api-cn.faceplusplus.com/facepp/v3/detect'\n",
    "API_key = '1gRuqOTtXZ4eUPPKaiNn7e8TPYKAs9Xj'\n",
    "API_sercret = 'nXQPKxbVyRlG4VHUndCvtHmcbE72It_1'\n",
    "payload = {\n",
    "    'api_key':'1gRuqOTtXZ4eUPPKaiNn7e8TPYKAs9Xj',\n",
    "    'api_secret':'nXQPKxbVyRlG4VHUndCvtHmcbE72It_1',\n",
    "    'image_url':'https://tse4-mm.cn.bing.net/th/id/OIP-C.AzDZGug1zMS_9bRE7IuyVAHaHa?w=190&h=190&c=7&r=0&o=5&dpr=1.2&pid=1.7'\n",
    "}\n",
    "r = requests.post(base_url, params = payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. url (目标餐厅)\n",
    "base_url = 'https://api-cn.faceplusplus.com/facepp/v3/detect'\n",
    "\n",
    "# 2. 准备API_KEY\n",
    "API_key = '1gRuqOTtXZ4eUPPKaiNn7e8TPYKAs9Xj'\n",
    "API_sercret = 'nXQPKxbVyRlG4VHUndCvtHmcbE72It_1'\n",
    "\n",
    "payload = {\n",
    "    'api_key':'1gRuqOTtXZ4eUPPKaiNn7e8TPYKAs9Xj',\n",
    "    'api_secret':'nXQPKxbVyRlG4VHUndCvtHmcbE72It_1',\n",
    "    'image_url':'https://tse4-mm.cn.bing.net/th/id/OIP-C.AzDZGug1zMS_9bRE7IuyVAHaHa?w=190&h=190&c=7&r=0&o=5&dpr=1.2&pid=1.7'\n",
    "}\n",
    "\n",
    "\n",
    "r = requests.post(base_url, params = payload)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 2. 人脸分析（请尝试调用analyze）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 思考 ： 能否将一些功能作函数的封装，实现更加便捷的api调用\n",
    "def face_detect(api_key)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
